package com.steakliu.sun.demo.client.xml;

import com.alibaba.nacos.common.remote.client.RpcClient;
import com.steakliu.sun.client.SunClient;
import com.steakliu.sun.demo.api.UserService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/**
 * 功能说明：
 * <p>
 * Original @Author: steakliu-刘牌, 2023-01-14  21:30
 * <p>
 * Copyright (C)2020-2022  steakliu All rights reserved.
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:spring-client.xml"})
public class SpringClientApplication {

    @Autowired
    SunClient sunClient;

    @Test
    public void test() throws Exception {
        UserService userService = sunClient.create(UserService.class);
        String user = userService.getUser("liu");
        System.out.println(user);
    }
}
